﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GoShopping.BLL
{
    /// <summary>
    /// 抽象工厂
    /// </summary>
    class Factory_Member
    {
        internal static IMember CreateMemberOption(Model.Enumerations.Member_Roles role)
        {
            switch (role)
            {
                case GoShopping.Model.Enumerations.Member_Roles.Role_Member:
                    return new User_IMember();
                case GoShopping.Model.Enumerations.Member_Roles.Role_ProductManager:
                    return new ProductManager_IMember();
                case GoShopping.Model.Enumerations.Member_Roles.Role_SuperManager:
                    return new SuperManager_IMember();
                case GoShopping.Model.Enumerations.Member_Roles.Role_UserManager:
                    return new UserManager_IMember();
                default:
                    throw(new Exception("Undifieded Role"));
                    //return null;
            }
        }
    }
}
